home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / basic2-logo.scm.z / basic2-logo.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  2.7 KB  |  65 lines

  1. ;  HIGHLIGHT-DROP-SHADOW-LOGO
  2. ;  draw the specified text over a background with a drop shadow and a highlight
  3.  
  4. (define (color-highlight color)
  5.   (let ((r (car color))
  6.     (g (cadr color))
  7.     (b (caddr color)))
  8.     (set! r (+ r (* (- 255 r) 0.75)))
  9.     (set! g (+ g (* (- 255 g) 0.75)))
  10.     (set! b (+ b (* (- 255 b) 0.75)))
  11.     (list r g b)))
  12.  
  13. (define (script-fu-basic2-logo text size font bg-color text-color)
  14.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  15.      (text-layer (car (gimp-text img -1 0 0 text 10 TRUE size PIXELS "*" font "*" "*" "*" "*")))
  16.      (width (car (gimp-drawable-width text-layer)))
  17.      (height (car (gimp-drawable-height text-layer)))
  18.      (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
  19.      (highlight-layer (car (gimp-layer-copy text-layer TRUE)))
  20.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
  21.      (old-fg (car (gimp-palette-get-foreground)))
  22.      (old-bg (car (gimp-palette-get-background))))
  23.     (gimp-image-disable-undo img)
  24.     (gimp-image-resize img width height 0 0)
  25.     (gimp-image-add-layer img bg-layer 1)
  26.     (gimp-image-add-layer img shadow-layer 1)
  27.     (gimp-image-add-layer img highlight-layer 1)
  28.     (gimp-palette-set-background text-color)
  29.     (gimp-layer-set-preserve-trans text-layer TRUE)
  30.     (gimp-edit-fill img text-layer)
  31.     (gimp-edit-clear img shadow-layer)
  32.     (gimp-palette-set-background (color-highlight text-color))
  33.     (gimp-layer-set-preserve-trans highlight-layer TRUE)
  34.     (gimp-edit-fill img highlight-layer)
  35.     (gimp-palette-set-background bg-color)
  36.     (gimp-drawable-fill bg-layer BG-IMAGE-FILL)
  37.     (gimp-selection-layer-alpha img text-layer)
  38.     (gimp-palette-set-background '(0 0 0))
  39.     (gimp-selection-feather img 7.5)
  40.     (gimp-edit-fill img shadow-layer)
  41.     (gimp-selection-none img)
  42.     (gimp-palette-set-foreground '(255 255 255))
  43.     (gimp-blend img text-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 0 0 width height)
  44.     (gimp-layer-translate shadow-layer 3 3)
  45.     (gimp-layer-translate highlight-layer -2 -2)
  46.     (gimp-layer-set-name text-layer text)
  47.     (gimp-layer-set-name highlight-layer "Highlight")
  48.     (gimp-palette-set-background old-bg)
  49.     (gimp-palette-set-foreground old-fg)
  50.     (gimp-image-enable-undo img)
  51.     (gimp-display-new img)))
  52.  
  53. (script-fu-register "script-fu-basic2-logo"
  54.             "<Toolbox>/Xtns/Script-Fu/Logos/Basic II"
  55.             "Creates a simple logo with a shadow and a highlight"
  56.             "Spencer Kimball"
  57.             "Spencer Kimball"
  58.             "1996"
  59.             ""
  60.             SF-VALUE "Text String" "\"SCRIPT-FU\""
  61.             SF-VALUE "Font Size (in pixels)" "150"
  62.             SF-VALUE "Font" "\"futura_poster\""
  63.             SF-COLOR "Background Color" '(255 255 255)
  64.             SF-COLOR "Text Color" '(206 6 50))
  65.